<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    const arr1 = [1, 2, 3];
    const arr2 = [4, 5, 6];

    /* 需求：把两个数组合并为一个数组 [1,2,3,4,5,6] */
    console.log(arr1.concat(arr2));

    /* es6 里面提供一个新的运算符 ... 这三个点叫做展开运算符，代表是把变量展开 */

    const concatArr = [...arr1, ...arr2];
    console.log(concatArr);


    // 在指定的位置进行展开
    const arr3 = ['a', 'b', 'c', ...arr1, 'd', 'e', 'f'];

    console.log(arr3);







</script>

</html>